package com.ax.base.common.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.ax.base.common.domain.BaseDoctor;
import com.ax.base.common.domain.BasePharmacist;
import com.ax.base.system.domain.SysUserDO;

@Mapper
public interface DoctorPharmacistMapper {

	/**
	 * 新增药师详情(模块:药师)
	 * 
	 * @param BasePharmacist basePharmacist
	 *           
	 * @return SUCC
	 */
	@Options(useGeneratedKeys = true, keyProperty = "pharmacistId")
	@Insert("insert into base_pharmacist (Pharmacist_ID, Pharmacist_Name, Org_ID,"+ 
		     "Org_Name, Subject_Code, Subject_Name,"+ 
		     "Title_Code, Title_Name, Entry_Job_Date,"+ 
		      "Person_ID, Empno, Sex,"+ 
		      "Birth, Phone, Address,"+ 
		      "Introduction, Expertise, Remarks,"+ 
		      "create_date, update_date, Flag,Tribunal_Fee"+
		      ")"+
		    "values (#{pharmacistId}, #{pharmacistName}, #{orgId},"+ 
		      "#{orgName}, #{subjectCode}, #{subjectName},"+
		      "#{titleCode}, #{titleName}, #{entryJobDate}, "+
		      "#{personId}, #{empno}, #{sex},"+
		      "#{birth}, #{phone}, #{address}," +
		      "#{introduction}, #{expertise}, #{remarks},NOW(), #{updateDate}, #{flag},#{tribunalFee}"+
		      ")")
	void insertBasePharmacistMapper(BasePharmacist basePharmacist);
	
	
	/**
	 * 查看药师详情(修改)
	 * 
	 * @param Long id
	 *           
	 * @return SUCC
	 */
	@Select("<script>"+
			"select "+ 
			"base_pharmacist.Pharmacist_ID pharmacistId,base_pharmacist.Pharmacist_Name pharmacistName,"+
			"base_pharmacist.Org_ID orgId,base_pharmacist.Org_Name orgName,base_pharmacist.Subject_Code subjectCode,"+
			"base_pharmacist.Subject_Name subjectName,base_pharmacist.Title_Code titleCode,"+
		    "base_pharmacist.Title_Name titleName,base_pharmacist.Entry_Job_Date entryJobDate,"+
		    "base_pharmacist.Person_ID personId, base_pharmacist.Empno empno, base_pharmacist.Sex sex,"+ 
		    "base_pharmacist.Birth birth, base_pharmacist.Phone phone, base_pharmacist.Address address,"+ 
		    "base_pharmacist.Introduction introduction,"+ 
		    "base_pharmacist.Expertise expertise, base_pharmacist.Remarks remarks,"+ 
		    "base_pharmacist.create_date createDate, base_pharmacist.update_date updateDate,"+ 
		    "base_pharmacist.Flag flag,"+
		    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
		    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction,"+
		    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_pharmacist.Tribunal_Fee tribunalFee "+
		    "from base_pharmacist "+
		    "left join base_org on base_pharmacist.Org_ID = base_org.Org_ID"+
		    "<where>"+
		    "<if test=\"pharmacistId != null\">"+ "and base_pharmacist.Pharmacist_ID = #{pharmacistId} " + "</if>" + 
		    "</where>"+
		    "</script>"
			)
	BasePharmacist getPharmacistMapper(@Param("pharmacistId") Long pharmacistId);
	
	/**
	 * 查看药师详情(模块:药师，药师详情)
	 * 
	 * @param Map<String, Object> map
	 *           
	 * @return List<BasePharmacist>
	 */
	@Select("<script>"+
			"select "+ 
			"base_pharmacist.Pharmacist_ID pharmacistId,base_pharmacist.Pharmacist_Name pharmacistName,"+
			"base_pharmacist.Org_ID orgId,base_pharmacist.Org_Name orgName,base_pharmacist.Subject_Code subjectCode,"+
			"base_pharmacist.Subject_Name subjectName,base_pharmacist.Title_Code titleCode,"+
		    "base_pharmacist.Title_Name titleName,base_pharmacist.Entry_Job_Date entryJobDate,"+
		    "base_pharmacist.Person_ID personId, base_pharmacist.Empno empno, base_pharmacist.Sex sex,"+ 
		    "base_pharmacist.Birth birth, base_pharmacist.Phone phone, base_pharmacist.Address address,"+ 
		    "base_pharmacist.Introduction introduction,"+ 
		    "base_pharmacist.Expertise expertise, base_pharmacist.Remarks remarks,"+ 
		    "base_pharmacist.create_date createDate, base_pharmacist.update_date updateDate,"+ 
		    "base_pharmacist.Flag flag,"+
		    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
		    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction,"+
		    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_pharmacist.Tribunal_Fee tribunalFee "+
		    "from base_pharmacist "+
		    "left join base_org on base_pharmacist.Org_ID = base_org.Org_ID"+
		    "<where>"+
		    "<if test=\"pharmacistId != null\">"+ "and base_pharmacist.Pharmacist_ID = #{pharmacistId} " + "</if>" + 
		    "</where>"+
		   /* "<if test=\"offset != null and limit != null\">"+
			"limit #{offset}, #{limit}" + 
			"</if>"+ */
		    "</script>"
			)
	List<BasePharmacist> selectByPrimaryKey(Map<String, Object> params);
	
	/**
	 * 查看药师详情(分页总计)
	 * 
	 * @param Map<String, Object> map
	 *           
	 * @return Integer
	 */
	@Select("<script>"+
			"select count(0) "+
            "from base_pharmacist "+
            "left join base_org on base_pharmacist.Org_ID = base_org.Org_ID"+
            "<where>"+
            "<if test=\"pharmacistId != null\">"+ "and base_pharmacist.Pharmacist_ID = #{pharmacistId} " + "</if>" + 
		    "</where>"+
		    "</script>")
	Integer count(Map<String, Object> params);
	
	/**
	 * 修改药师详情(模块:药师)
	 * 
	 * @param Map<String, Object> map
	 *           
	 * @return SUCC
	 */
	@Update("<script>"+
			"update base_pharmacist"+
            "<set>"+
            "<if test=\"pharmacistName != null\">"+ "Pharmacist_Name = #{pharmacistName}," + "</if>" +
            "<if test=\"orgId != null\">"+ "Org_ID = #{orgId}," + "</if>" +
            "<if test=\"orgName != null\">"+ "Org_Name = #{orgName}," + "</if>" +
            "<if test=\"subjectCode != null\">"+ "Subject_Code = #{subjectCode}," + "</if>" +
            "<if test=\"subjectName != null\">"+ "Subject_Name = #{subjectName}," + "</if>" +
            "<if test=\"titleCode != null\">"+ "Title_Code = #{titleCode}," + "</if>" +
            "<if test=\"titleName != null\">"+ "Title_Name = #{titleName}," + "</if>" +
            "<if test=\"entryJobDate != null\">"+ "Entry_Job_Date = #{entryJobDate}," + "</if>" +
            "<if test=\"personId != null\">"+ "Person_ID = #{personId}," + "</if>" +
            "<if test=\"empno != null\">"+ "Empno = #{empno}," + "</if>" +
            "<if test=\"sex != null\">"+ "Sex = #{sex}," + "</if>" +
            "<if test=\"birth != null\">"+ "Birth = #{birth}," + "</if>" +
            "<if test=\"phone != null\">"+ "Phone = #{phone}," + "</if>" +
            "<if test=\"address != null\">"+ "Address = #{address}," + "</if>" +
            "<if test=\"introduction != null\">"+ "Introduction = #{introduction}," + "</if>" +
            "<if test=\"remarks != null\">"+ "Remarks = #{remarks}," + "</if>" +
            "<if test=\"createDate != null\">"+ "create_date = #{createDate}," + "</if>" +
            "update_date = NOW()," + 
            "<if test=\"flag != null\">"+ "Flag = #{flag}," + "</if>" +
            "<if test=\"tribunalFee != null\">"+ "Tribunal_Fee = #{tribunalFee}," + "</if>" +
            "</set>"+
            "where Pharmacist_ID = #{pharmacistId,jdbcType=BIGINT}"+
            "</script>")
	void updateBasePharmacistMapper(Map<String, Object> params);
	
	/**
	 * 查看医生详情(模块:医生呈现，医生详情*查询某科室下面的医生)
	 * 
	 * @param Map<String, Object> map
	 *           
	 * @return List<BaseDoctor>
	 */
	@Select("<script>"+
	"select "+ 
	"base_doctor.Doctor_ID doctorId,base_doctor.Doctor_Name doctorName,base_doctor.Org_ID orgId,base_doctor.Org_Name orgName,"+
	"base_doctor.Subject_Code subjectCode,base_doctor.Subject_Name subjectName,base_doctor.Title_Code titleCode,"+ 
    "base_doctor.Title_Name titleName, base_doctor.Label label,base_doctor.Entry_Job_Date entryJobDate,"+
    "base_doctor.Person_ID personId, base_doctor.Empno empno, base_doctor.Sex sex, base_doctor.Birth birth, "+
    "base_doctor.Phone phone, base_doctor.Address address, "+
    "base_doctor.Introduction introduction, base_doctor.Expertise expertise, base_doctor.Remarks remarks, "+
    "base_doctor.create_date createDate, base_doctor.update_date updateDate, base_doctor.Flag flag,"+
    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction," +
    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_doctor.Inquiry_Fee inquiryFee "+
    "from base_doctor "+
    "left join base_Org on base_doctor.Org_ID = base_Org.Org_ID "+
    "left join base_subject on base_doctor.Subject_Code = base_subject.Subject_Code"+
    "<where>" +
    "<if test=\"doctorId != null\">"+ "and base_doctor.Doctor_ID = #{doctorId} " + "</if>" + 
    "<if test=\"subjectId != null\">"+ "and base_doctor.Subject_ID = #{subjectId} " + "</if>" + 
    "</where>"+
 /* "<if test=\"offset != null and limit != null\">"+
	"limit #{offset}, #{limit}" + 
	"</if>"+*/
	"</script>")
	List<BaseDoctor> queryBaseDoctorMapper(Map<String, Object> params);
	
	/**
	 * 查看医师详情(修改)
	 * 
	 * @param Long doctorId
	 *           
	 * @return BaseDoctor baseDoctor
	 */
	@Select("<script>"+
			"select "+ 
			"base_doctor.Doctor_ID doctorId,base_doctor.Doctor_Name doctorName,base_doctor.Org_ID orgId,base_doctor.Org_Name orgName,"+
			"base_doctor.Subject_Code subjectCode,base_doctor.Subject_Name subjectName,base_doctor.Title_Code titleCode,"+ 
		    "base_doctor.Title_Name titleName, base_doctor.Label label,base_doctor.Entry_Job_Date entryJobDate,"+
		    "base_doctor.Person_ID personId, base_doctor.Empno empno, base_doctor.Sex sex, base_doctor.Birth birth, "+
		    "base_doctor.Phone phone, base_doctor.Address address, "+
		    "base_doctor.Introduction introduction, base_doctor.Expertise expertise, base_doctor.Remarks remarks, "+
		    "base_doctor.create_date createDate, base_doctor.update_date updateDate, base_doctor.Flag flag,"+
		    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
		    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction," +
		    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_doctor.Inquiry_Fee inquiryFee "+
		    "from base_doctor "+
		    "left join base_Org on base_doctor.Org_ID = base_Org.Org_ID "+
		    "left join base_subject on base_doctor.Subject_Code = base_subject.Subject_Code"+
		    "<where>" +
		    "<if test=\"doctorId != null\">"+ "and base_doctor.Doctor_ID = #{doctorId} " + "</if>" + 
		    "</where>"+
			"</script>")
	BaseDoctor getDoctorMapper(@Param("doctorId") Long doctorId);
	/**
	 * 查看医生详情(分页总计)
	 * 
	 * @param Map<String, Object> map
	 *           
	 * @return Integer
	 */
	@Select("<script>"+
			"select count(0) "+
            "from base_doctor "+
            "left join base_Org on base_doctor.Org_ID = base_Org.Org_ID "+
            "left join base_subject on base_doctor.Subject_Code = base_subject.Subject_Code"+
            "<where>"+
            "<if test=\"doctorId != null\">"+ "and base_doctor.Doctor_ID = #{doctorId} " + "</if>" + 
            "<if test=\"subjectId != null\">"+ "and base_doctor.Subject_ID = #{subjectId} " + "</if>" + 
		    "</where>"+
		    "</script>")
	Integer baseDoctorCount(Map<String, Object> params);
	
	@Options(useGeneratedKeys = true, keyProperty = "doctorId")
	@Insert("insert into base_doctor (Doctor_ID, Doctor_Name, Org_ID, "+
		      "Org_Name, Subject_Code, Subject_Name," +
		      "Title_Code, Title_Name, Label," +
		      "Entry_Job_Date, Person_ID, Empno,"+ 
		      "Sex, Birth, Phone, Address," +
		      "Introduction, Expertise, Remarks,"+ 
		      "create_date, update_date, Flag,Inquiry_Fee"+
		      ")"+
		    "values (#{doctorId}, #{doctorName}, #{orgId}," +
		      "#{orgName}, #{subjectCode}, #{subjectName},"+ 
		      "#{titleCode}, #{titleName}, #{label}, "+
		      "#{entryJobDate}, #{personId}, #{empno}, "+
		      "#{sex}, #{birth}, #{phone}, #{address}," +
		      "#{introduction}, #{expertise}, #{remarks}, "+
		      "NOW(), #{updateDate}, #{flag},#{inquiryFee}" +
		      ")")
	void insertBaseDoctorMapper(BaseDoctor baseDoctor);
	
	/**
	 * 修改医生详情(模块:医生)
	 * 
	 * @param BaseDoctor baseDoctor
	 *           
	 * @return SUCC
	 */
	@Update("<script>"+
			"update base_doctor"+
            "<set>"+
            "<if test=\"doctorName != null\">"+ "Doctor_Name = #{doctorName}," + "</if>" +
            "<if test=\"orgId != null\">"+ "Org_ID = #{orgId}," + "</if>" +
            "<if test=\"orgName != null\">"+ "Org_Name = #{orgName}," + "</if>" +
            "<if test=\"subjectCode != null\">"+ "Subject_Code = #{subjectCode}," + "</if>" +
            "<if test=\"subjectName != null\">"+ "Subject_Name = #{subjectName}," + "</if>" +
            "<if test=\"titleCode != null\">"+ "Title_Code = #{titleCode}," + "</if>" +
            "<if test=\"titleName != null\">"+ "Title_Name = #{titleName}," + "</if>" +
            "<if test=\"entryJobDate != null\">"+ "Entry_Job_Date = #{entryJobDate}," + "</if>" +
            "<if test=\"personId != null\">"+ "Person_ID = #{personId}," + "</if>" +
            "<if test=\"empno != null\">"+ "Empno = #{empno}," + "</if>" +
            "<if test=\"sex != null\">"+ "Sex = #{sex}," + "</if>" +
            "<if test=\"birth != null\">"+ "Birth = #{birth}," + "</if>" +
            "<if test=\"phone != null\">"+ "Phone = #{phone}," + "</if>" +
            "<if test=\"address != null\">"+ "Address = #{address}," + "</if>" +
            "<if test=\"introduction != null\">"+ "Introduction = #{introduction}," + "</if>" +
            "<if test=\"remarks != null\">"+ "Remarks = #{remarks}," + "</if>" +
            "<if test=\"createDate != null\">"+ "create_date = #{createDate}," + "</if>" +
            "update_date = NOW()," + 
            "<if test=\"flag != null\">"+ "Flag = #{flag}," + "</if>" +
            "<if test=\"inquiryFee != null\">"+ "Inquiry_Fee = #{inquiryFee}," + "</if>" +
            "</set>"+
            "where Doctor_ID = #{doctorId,jdbcType=BIGINT}"+
            "</script>")
	void updateBaseDoctorMapper(BaseDoctor baseDoctor);
	
	/**
	 * 医师是否重复(新增)
	 * 
	 * @param Map<String,Object> map
	 *         
	 * @return boolean
	 */
	@Select("<script>"+
			"select "+ 
			"base_doctor.Doctor_ID doctorId,base_doctor.Doctor_Name doctorName,base_doctor.Org_ID orgId,base_doctor.Org_Name orgName,"+
			"base_doctor.Subject_Code subjectCode,base_doctor.Subject_Name subjectName,base_doctor.Title_Code titleCode,"+ 
		    "base_doctor.Title_Name titleName, base_doctor.Label label,base_doctor.Entry_Job_Date entryJobDate,"+
		    "base_doctor.Person_ID personId, base_doctor.Empno empno, base_doctor.Sex sex, base_doctor.Birth birth, "+
		    "base_doctor.Phone phone, base_doctor.Address address, "+
		    "base_doctor.Introduction introduction, base_doctor.Expertise expertise, base_doctor.Remarks remarks, "+
		    "base_doctor.create_date createDate, base_doctor.update_date updateDate, base_doctor.Flag flag,"+
		    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
		    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction," +
		    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_doctor.Inquiry_Fee inquiryFee "+
		    "from base_doctor "+
		    "left join base_Org on base_doctor.Org_ID = base_Org.Org_ID "+
		    "left join base_subject on base_doctor.Subject_Code = base_subject.Subject_Code"+
		    "<where>" +
		    "<if test=\"personId != null\">"+ "and base_doctor.Person_ID = #{personId} " + "</if>" + 
		    "<if test=\"empno != null\">"+ "and base_doctor.Empno = #{empno} " + "</if>" + 
		    "</where>"+
			"</script>")
	List<BaseDoctor> doctorValidateMapper(Map<String,Object> map);
	
	/**
	 * 医师是否重复(修改)
	 * 
	 * @param Map<String,Object> map
	 *         
	 * @return boolean
	 */
	@Select("<script>"+
			"select "+ 
			"base_doctor.Doctor_ID doctorId,base_doctor.Doctor_Name doctorName,base_doctor.Org_ID orgId,base_doctor.Org_Name orgName,"+
			"base_doctor.Subject_Code subjectCode,base_doctor.Subject_Name subjectName,base_doctor.Title_Code titleCode,"+ 
		    "base_doctor.Title_Name titleName, base_doctor.Label label,base_doctor.Entry_Job_Date entryJobDate,"+
		    "base_doctor.Person_ID personId, base_doctor.Empno empno, base_doctor.Sex sex, base_doctor.Birth birth, "+
		    "base_doctor.Phone phone, base_doctor.Address address, "+
		    "base_doctor.Introduction introduction, base_doctor.Expertise expertise, base_doctor.Remarks remarks, "+
		    "base_doctor.create_date createDate, base_doctor.update_date updateDate, base_doctor.Flag flag,"+
		    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
		    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction," +
		    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_doctor.Inquiry_Fee inquiryFee "+
		    "from base_doctor "+
		    "left join base_Org on base_doctor.Org_ID = base_Org.Org_ID "+
		    "left join base_subject on base_doctor.Subject_Code = base_subject.Subject_Code"+
		    "<where>" +
		    "<if test=\"doctorId != null\">"+ "and base_doctor.Doctor_ID != #{doctorId} " + "</if>" + 
		    "<if test=\"personId != null\">"+ "and base_doctor.Person_ID = #{personId} " + "</if>" + 
		    "<if test=\"empno != null\">"+ "and base_doctor.Empno = #{empno} " + "</if>" + 
		    "</where>"+
			"</script>")
	List<BaseDoctor> updateDoctorValidateMapper(Map<String,Object> map);
	
	/**
	 * 药师是否重复(新增)
	 * 
	 * @param Map<String,Object> map
	 *         
	 * @return boolean
	 */
	@Select("<script>"+
			"select "+ 
			"base_pharmacist.Pharmacist_ID pharmacistId,base_pharmacist.Pharmacist_Name pharmacistName,"+
			"base_pharmacist.Org_ID orgId,base_pharmacist.Org_Name orgName,base_pharmacist.Subject_Code subjectCode,"+
			"base_pharmacist.Subject_Name subjectName,base_pharmacist.Title_Code titleCode,"+
		    "base_pharmacist.Title_Name titleName,base_pharmacist.Entry_Job_Date entryJobDate,"+
		    "base_pharmacist.Person_ID personId, base_pharmacist.Empno empno, base_pharmacist.Sex sex,"+ 
		    "base_pharmacist.Birth birth, base_pharmacist.Phone phone, base_pharmacist.Address address,"+ 
		    "base_pharmacist.Introduction introduction,"+ 
		    "base_pharmacist.Expertise expertise, base_pharmacist.Remarks remarks,"+ 
		    "base_pharmacist.create_date createDate, base_pharmacist.update_date updateDate,"+ 
		    "base_pharmacist.Flag flag,"+
		    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
		    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction,"+
		    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_pharmacist.Tribunal_Fee tribunalFee "+
		    "from base_pharmacist "+
		    "left join base_org on base_pharmacist.Org_ID = base_org.Org_ID"+
		    "<where>"+
		    "<if test=\"personId != null\">"+ "and base_pharmacist.Person_ID = #{personId} " + "</if>" + 
		    "<if test=\"empno != null\">"+ "and base_pharmacist.Empno = #{empno} " + "</if>" + 
		    "</where>"+
		    "</script>"
			)
	List<BasePharmacist> pharmacistValidateMapper(Map<String,Object> map);
	
	/**
	 * 药师是否重复(修改)
	 * 
	 * @param Map<String,Object> map
	 *         
	 * @return boolean
	 */
	@Select("<script>"+
			"select "+ 
			"base_pharmacist.Pharmacist_ID pharmacistId,base_pharmacist.Pharmacist_Name pharmacistName,"+
			"base_pharmacist.Org_ID orgId,base_pharmacist.Org_Name orgName,base_pharmacist.Subject_Code subjectCode,"+
			"base_pharmacist.Subject_Name subjectName,base_pharmacist.Title_Code titleCode,"+
		    "base_pharmacist.Title_Name titleName,base_pharmacist.Entry_Job_Date entryJobDate,"+
		    "base_pharmacist.Person_ID personId, base_pharmacist.Empno empno, base_pharmacist.Sex sex,"+ 
		    "base_pharmacist.Birth birth, base_pharmacist.Phone phone, base_pharmacist.Address address,"+ 
		    "base_pharmacist.Introduction introduction,"+ 
		    "base_pharmacist.Expertise expertise, base_pharmacist.Remarks remarks,"+ 
		    "base_pharmacist.create_date createDate, base_pharmacist.update_date updateDate,"+ 
		    "base_pharmacist.Flag flag,"+
		    "base_Org.Org_Short_Name orgShortName,base_Org.Area_Code areaCode,base_Org.Area_Name areaName,"+
		    "base_Org.Grade_Code gradeCode,base_Org.Grade_Name gradeName,base_Org.Introduction orgIntroduction,"+
		    "base_Org.Phone orgPhone,base_Org.Address orgAddress,base_Org.Org_Type_Name orgTypeName,base_pharmacist.Tribunal_Fee tribunalFee "+
		    "from base_pharmacist "+
		    "left join base_org on base_pharmacist.Org_ID = base_org.Org_ID"+
		    "<where>"+
		    "<if test=\"pharmacistId != null\">"+ "and base_doctor.Pharmacist_ID != #{pharmacistId} " + "</if>" + 
		    "<if test=\"personId != null\">"+ "and base_doctor.Person_ID = #{personId} " + "</if>" + 
		    "<if test=\"empno != null\">"+ "and base_doctor.Empno = #{empno} " + "</if>" +
		    "</where>"+
		    "</script>"
			)
	List<BasePharmacist> updatePharmacistValidateMapper(Map<String,Object> map);
	
	
	@Insert("insert into sys_user (`username`, `password`, `email`, `mobile`, `status`, `user_id_create`, `gmt_create`, `gmt_modified`, `name`,`user_type_Code`,`user_type_Name`,`user_code`,`Flag`)"
	+ "values (#{username}, #{password}, #{email}, #{mobile}, #{status}, #{userIdCreate}, #{gmtCreate}, #{gmtModified}, #{name},#{userTypeCode},#{userTypeName},#{userCode},#{flag})")
	void insertUser(SysUserDO obj);
}
